﻿using System;
using System.Collections.Generic;
using System.Text;
using DCRF.Common.Core;

namespace DCRF.Common.Connection.Wrappers
{
    /// <summary>
    /// just a helper class to prevent rewriting keys
    /// </summary>
    public class BlockProperty<T> : BlockConnectorBase
    {
        public BlockProperty(BlockBase parent, string key)
            : base(parent, key)
        {
        }

        public T GetValue()
        {
            return (T)Connector.ProcessRequest();
        }

        public List<T> GetValues()
        {
            List<T> result = new List<T>();

            foreach (object item in Connector.ProcessRequestAll())
            {
                result.Add((T)item);
            }

            return result;
        }
    }
}
